package com.hwh.service.emp.impl;

import java.util.List;

import com.hwh.DAO.emp.EmployeeDAO;
import com.hwh.model.emp.Employee;
import com.hwh.service.emp.EmployeeService;

public class EmployeeServiceImpl implements EmployeeService {

	private EmployeeDAO employeeDAO;
	public void addEmployee(Employee employee) {
		employeeDAO.save(employee);

	}

	public void deleteEmployee(String id) {
		employeeDAO.delete(employeeDAO.findById(id));

	}

	public void updataEmployee(Employee employee) {
		employeeDAO.save(employee);

	}

	public List findEmployee(String propertyName, Object value) {
		// TODO Auto-generated method stub
		return employeeDAO.findByProperty(propertyName, value);
	}

	public List findAllEmployee() {
		// TODO Auto-generated method stub
		return employeeDAO.findAll();
	}

	public List findByPage(int currentPage, int pageSize) {
		// TODO Auto-generated method stub
		return employeeDAO.findByPage(currentPage, pageSize);
	}

	public EmployeeDAO getEmployeeDAO() {
		return employeeDAO;
	}

	public void setEmployeeDAO(EmployeeDAO employeeDAO) {
		this.employeeDAO = employeeDAO;
	}

}
